//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Windows.Documents;
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class TextLineBreak : RunBase
    {
        private TextCharacterProperties rPr;

        public TextCharacterProperties CharacterProperties
        {
            get { return rPr; }
            set { rPr = value; }
        }


        internal override Inline Inline
        {
            get { throw new NotImplementedException(); }
        }

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read("br"))
            {
                CharacterProperties = c.ReadOptionalElementAs<TextCharacterProperties>("rPr");
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write("br"))
            {
                c.WriteOptionalElementAs(CharacterProperties, "rPr");
            }
        }
    }
}